<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page session="false"%>
<%@ page contentType="text/html; charset=UTF-8"%>

<sec:authorize ifNotGranted="ROLE_ADMIN,ROLE_USER">
<div id="login" class="tip_box">
	<div class="title">欢迎登陆</div>
	<form action="j_spring_security_check" method="post">
		<div class="tips"></div>
		<p>
			<label for="username">用户名：</label><input type="text" name="j_username" value="${sessionScope['SPRING_SECURITY_LAST_USERNAME']}" class="userpass" size="24"/>
		</p>
		<p>
			<label for="password">密　码：</label><input type="password" name="j_password" class="userpass" size="24"/>								
		</p>
		<p class="btn">
			<input type="submit" value="登录" class="btn_login"/>
			<a href="user/register" target="_blank" class="reg">免费注册</a>
		</p>
		<span class="remember">			
			<input type="checkbox" name="_spring_security_remember_me" checked="checked"/>
			<label for="RemenberMe">记住我</label>
		</span>
		<a href="" target="_blank" class="forget" name="forget">忘记密码？</a>
	</form>
</div>
</sec:authorize>

<sec:authorize ifAnyGranted="ROLE_ADMIN,ROLE_USER">
	<tiles:importAttribute/>
	<div id="me" class="tip_box">
		<dl>
			<dt><img src="images/me.jpg"/></dt>
			<dd>
				<a href="user/${user.username}"><sec:authentication property="name"/></a>
				<a href="j_spring_security_logout">退出</a>
			</dd>
			<dd>我的签名</dd>
		</dl>
	</div>
</sec:authorize>

<div class="tip_box">
	<h2>消息或者列表</h2>
	<p class="tips">这里是消息消息消息消息消息消息消息消息
	</p>
	<a href="#" class="read_more">read more</a>
</div>

<script language="JavaScript" type="text/javascript">
	//<![CDATA[
	$(function(){
		try{
		}catch(e){alert(e);}
	});
	//]]>
</script>